package com.wxy.demo.executor;

import java.sql.Array;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 线程停止
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2022/10/11 14:42
 */
public class Demo4 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            try {
                TimeUnit.SECONDS.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("子线程执行完成");
        });
        thread.start();
        TimeUnit.SECONDS.sleep(1);
        thread.stop();
//        thread.start();
    }
}
